<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    div{
      width: 300px;
      background-color: rgba(0,0,0,0.3);/*黑色半透明*/
      padding: 10px;/*四个方向内边距*/
    }
    input{
      width: 260px;/*300-内边距20*2*/
      padding: 10px 20px;
        border: 0;/*去掉自带边框*/
    }
    img{
        /*设置为绝对定位 为了层叠效果*/
        position: absolute;
        top: 14px;
        right: 30px;
    }
    p{
        font-size: 12px;
        margin: 0;
        color: red;
    }
  </style>
</head>
<body>
<div>
    <input type="text" placeholder="请输入用户名">
    <img src="http://canglaoshi.org/tstore_v1/images/login/yhm.png" alt="">
    <p>用户名不能为空</p>
</div>
</body>
</html>